# #创建类
# class Animal:
#     name ='animal'
#     def shout(self):
#         print('animal shout')
# #创建对象
# animal=Animal()
# print(animal.name)
# animal.shout()

class Dog:
    name='dog'
    def __init__(self):
        self.age = 10
    def eat(self):
        print('dog eat')

dog =Dog()
print(dog.name)
dog.eat()
print('---------')

dog1=Dog()
print(dog1.name)
print(Dog.name)
print('---------')
#对象修改
dog1.name='dog1'
print(dog1.name)
print(Dog.name)
print('---------')
#类修改..类属性只能通过类来修改
Dog.name='ddddd'
print(dog1.name)
print(Dog.name)
print('---------')
dog2=Dog()
print(dog2.name)
print(dog2.age)

